home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scmimedata.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-08-10  |  2.8 KB  |  84 lines

  1. /*
  2.  For general Scribus (>=1.3.2) copyright and licensing information please refer
  3.  to the COPYING file provided with the program. Following this notice may exist
  4.  a copyright and/or license notice that predates the release of Scribus 1.3.2
  5.  for which a new license (GPL+exception) is in place.
  6.  */
  7. /***************************************************************************
  8. *                                                                         *
  9. *   This program is free software; you can redistribute it and/or modify  *
  10. *   it under the terms of the GNU General Public License as published by  *
  11. *   the Free Software Foundation; either version 2 of the License, or     *
  12. *   (at your option) any later version.                                   *
  13. *                                                                         *
  14. ***************************************************************************/
  15.  
  16.  
  17.  
  18. #ifndef SCMIMEDATA_H
  19. #define SCMIMEDATA_H
  20.  
  21. #include <QByteArray>
  22. #include <QMimeData>
  23. #include <QString>
  24. #include <QStringList>
  25. #include <QVariant>
  26.  
  27. #include "scribusapi.h"
  28.  
  29. class SCRIBUS_API ScMimeData
  30. {
  31. public:
  32.     static const QString ScribusElemMimeType;
  33.     static const QString ScribusFragmentMimeType;
  34.     static const QString ScribusTextMimeType;
  35.  
  36.     static bool clipboardHasScribusData(void);
  37.     static bool clipboardHasScribusElem(void);
  38.     static bool clipboardHasScribusFragment(void);
  39.     static bool clipboardHasScribusText(void);
  40.     static bool clipboardHasPlainText(void);
  41.  
  42.     static QString    clipboardScribusElem(void);
  43.     static QByteArray clipboardScribusFragment(void);
  44.     static QByteArray clipboardScribusText(void);
  45. };
  46.  
  47. class SCRIBUS_API ScFragmentMimeData : public QMimeData
  48. {
  49. public:
  50.     ScFragmentMimeData(void) : QMimeData() {};
  51.  
  52.     void setScribusFragment(const QByteArray& fragment) { setData(ScMimeData::ScribusFragmentMimeType, fragment); }
  53.     QByteArray scribusFragment(void) { return data(ScMimeData::ScribusFragmentMimeType); }
  54. };
  55.  
  56. class SCRIBUS_API ScElemMimeData : public QMimeData
  57. {
  58. protected:
  59.     QString     m_scribusElemData;
  60.     QStringList m_formats;
  61.  
  62.     virtual QVariant retrieveData ( const QString & mimeType, QVariant::Type type ) const;
  63.  
  64. public:
  65.     ScElemMimeData(void);
  66.  
  67.     virtual QStringList formats() const { return m_formats; }
  68.     virtual bool hasFormat ( const QString & mimeType ) const;
  69.  
  70.     void  setScribusElem(const QString& elem) { m_scribusElemData = elem; }
  71.     const QString& scribusElem(void) const    { return m_scribusElemData; }
  72. };
  73.  
  74. class SCRIBUS_API ScTextMimeData : public QMimeData
  75. {
  76. public:
  77.     ScTextMimeData(void) : QMimeData() {};
  78.  
  79.     void setScribusText(const QByteArray& scText) { setData(ScMimeData::ScribusTextMimeType, scText); }
  80.     QByteArray scribusText(void) { return data(ScMimeData::ScribusFragmentMimeType); }
  81. };
  82.  
  83. #endif
  84.